package StatePattern.example1;

public class HighScoreState implements ScoreState {
    private static HighScoreState singleton = new HighScoreState();

    HighScoreState() {

    }

    public static ScoreState getInstance() {
        return singleton;
    }

    @Override
    public String getStateName() {
        return "优秀";
    }

    @Override
    public void setScore(ScoreContext scoreContext, int score) {
        if (score < 60) {
            scoreContext.changeState(LowScoreState.getInstance());
        } else if (score < 80) {
            scoreContext.changeState(MidScoreState.getInstance());
        }
    }
}
